<template>
  <div>
    <el-table :data="data" border style="width: 100%">
        <el-table-column
          v-for="(item, i) in cols"
          :key="i"
          :prop="item.prop"
          :label="item.label"
          :type="item.type"
          :width="item.width"
        >
        <!-- 判断有没有slot属性 -->
          <template v-slot="{row}" v-if="item.slot">
            <!-- 指定插槽名，:row传参 row：当前行数据 -->
            <slot :name="item.slot" :row="row">
            </slot>
          </template>
        </el-table-column>
      
        
    </el-table>
  </div>
</template>

<script>
export default {
  name: "",
  props: {
    data: {
      type: Array,
      default: () => [],
    },
    cols: {
      type: Array,
      default: () => [],
    },
  },
  components: {},
  data() {
    return {};
  },
  created() {},
  mounted() {},
  methods: {
    tog(val) {
        console.log(val);
    },
    bj() {},
    jues() {},
    del() {},
  },
};
</script>

<style scoped lang='scss'>
</style>
